/**
 * 
 */
package service;

import java.util.List;

import model.*;
 
import org.springframework.dao.DataAccessException;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author james
 *
 */
 public interface Userservice {
	/*	*//**
	 * 
	 * @param salary
	 * @return
	 */
	/*
	 * @Transactional(readOnly=true) public User read(String fname,String
	 * lname);
	 *//**
	 * 
	 * @param id
	 * @return
	 */
	/*
	 * @Transactional(readOnly=true) public User read(int id);
	 *//**
	 * read all
	 * 
	 * @return
	 */
	/*
	 * @Transactional(readOnly=true) public List<User> read();
	 */
	 
	 
	 /**
	  * Person
	  * @return
	  */
 	 public List<Person> readPerson();
	 
	 /**
	  * Incident
	  * @return
	  */
 	 public List<Incident> readIncident();
	 
	 /**
	  * FollowPlan
	  * @return
	  */
 	 public List<FollowPlan> readPlan();
	
/*----------------------------------------------------------------*/ 	 
 	 /**
	  * Person
	  * @return
	  */
 	 public Person findPerson(int id);
	 
	 /**
	  * Incident
	  * @return
	  */
 	 public Incident findIncident(int id);
	 
	 /**
	  * FollowPlan
	  * @return
	  */
 	 public FollowPlan findPlan(int id);

/*----------------------------------------------------------------*/ 	 
 	 /**
	 * insert person
	 * @param fname
	 * @param lname
	 * @param position
	 * @param phone
	 * @param email
	 * @param age
	 * @param sex
	 */
	@Transactional(readOnly=false,rollbackFor = DataAccessException.class )
	public void insert(String fname,String lname,String position, int phone, String email, int age, String sex);
	
	/**
	 * insert incident
	 * @param incident_location
	 * @param gen
	 * @param inital
	 */
	@Transactional(readOnly=false,rollbackFor = DataAccessException.class )
	public void insertIncident(String incident_location,String gen,String inital);
	
	/**
	 * 
	 * @param type
	 * @param des
	 */
	@Transactional(readOnly=false,rollbackFor = DataAccessException.class )
	public void insertPlan(String type,String des);

/*-------------------------------------------------------------------	
*/	/**
	 * 
	 * @param type
	 * @param id
	 * @param info
	 */
	@Transactional(readOnly=false,rollbackFor = DataAccessException.class )
	public void updatePerson(String type, int id, String info);
	
	@Transactional(readOnly=false,rollbackFor = DataAccessException.class )
	public void deletePerson(int id);
	
	@Transactional(readOnly=false,rollbackFor = DataAccessException.class )
	public void updateIncident(String type, int id, String info);
	
	@Transactional(readOnly=false,rollbackFor = DataAccessException.class )
	public void deleteIncident(int id);
	
	@Transactional(readOnly=false,rollbackFor = DataAccessException.class )
	public void updatePlan(String type, int id, String info);
	
	@Transactional(readOnly=false,rollbackFor = DataAccessException.class )
	public void deletePlan(int id);
}
